<template>
  <footer class="footer">
    <div class="container">
      <div class="footer-main">
        <div class="footer-section about">
          <h3 class="title"></h3>
          <div class="logo">
            <img src="/avatar.jpg" alt="Logo" />
            <div>
              <p class="name">山海守门人</p>
              <p class="role">紫穹</p>
            </div>
          </div>
          <p class="motto">若见山鬼献果、精卫衔石，请代我将谢礼撒入归墟。</p>
        </div>
        <div v-for="(section, index) in footerSections" :key="index" class="footer-section" :class="{ links: index < 3, contact: index === 3 }">
          <h3 class="title">{{ section.title }}</h3>
          <ul>
            <li v-for="(item, itemIndex) in section.items" :key="itemIndex">
              <a v-if="item.link" :href="item.link">{{ item.name }}</a>
              <template v-else>{{ item.name }}</template>
            </li>
          </ul>
        </div>
      </div>
      <div class="footer-bottom">
        <p>© 2025 山海守门人. All rights reserved.</p>
        <div class="stats">
          <span v-for="(stat, index) in stats" :key="index">{{ stat }}</span>
        </div>
      </div>
    </div>
  </footer>
</template>

<script setup>
const footerSections = [
  {
    title: '产品',
    items: [
      { name: '易待办', link: '#' },
      { name: '拼图大师', link: '#' },
      { name: '马克吐文', link: '#' },
      { name: '开发工具', link: '#' }
    ]
  },
  {
    title: '开源项目',
    items: [
      { name: 'funpi', link: '#' },
      { name: 'yite-cli', link: '#' },
      { name: 'yicode-tools', link: '#' }
    ]
  },
  {
    title: '学习资源',
    items: [
      { name: 'Node.js全栈课程', link: '#' },
      { name: '代码变现指南', link: '#' },
      { name: '文档中心', link: '#' }
    ]
  },
  {
    title: '联系方式',
    items: [
      { name: '微信: shjz-zq', link: null },
      { name: '邮箱: sx.peng@163.com', link: null },
      { name: 'GitHub', link: '#' }
    ]
  }
]

const stats = [
]
</script>

<style lang="scss" scoped>
.footer {
  background-color: #2c3e50;
  color: #bdc3c7;
  padding: 40px 0;
  font-size: 14px;
  
  .container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px;
    
    .footer-main {
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      padding-bottom: 20px;
      border-bottom: 1px solid #34495e;
    }
    
    .footer-bottom {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 20px;
      font-size: 12px;
      
      .stats {
        span {
          margin-left: 20px;
        }
      }
    }
  }
}

.footer-section {
  margin-bottom: 20px;
  
  &.about {
    max-width: 250px;
  }
  
  .title {
    font-size: 16px;
    color: #ecf0f1;
    margin-bottom: 15px;
    font-weight: bold;
  }
  
  ul {
    list-style: none;
    padding: 0;
    margin: 0;
    
    li {
      margin-bottom: 10px;
      
      a {
        color: #bdc3c7;
        text-decoration: none;
        transition: color 0.3s;
        
        &:hover {
          color: #ecf0f1;
        }
      }
    }
  }
}

.logo {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  
  img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
  }
  
  .name {
    font-size: 20px;
    font-weight: bold;
    color: #ecf0f1;
    margin: 0;
  }
  
  .role {
    font-size: 12px;
    color: #95a5a6;
    margin: 0;
  }
}

.motto {
  line-height: 1.6;
}
</style>